﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace checksumdotnet
{
    // datatype
    public struct hash
    {
        private readonly Byte[] Bytedata;

        public hash(Byte[] ByteData)
        {
            Bytedata = ByteData;
        }

        public byte[] ToByte()
        {
            return Bytedata;
        }

        public override String ToString()
        {
            return Bytedata.ToString();
        }

        public String ToFormatedString()
        {
            var Return = new StringBuilder();
            for (int i = 0; i < Bytedata.Length; i++)
            {
                Return.Append(Bytedata[i].ToString("x2"));
            }
            return Return.ToString();
        }
    }

    class HashComputer
    {
        public delegate void HashComputerCallback(HashComputerEvent e, object message, object prams);

        public enum HashTypes
            {
            MD5,
            SHA1,
            SHA256,
            SHA384,
            SHA512,
            RIPEMD160
            }
        public enum AsyncCryptoUpdateEvents
            {
            Start,
            Progress,
            End,
            Interrupted,
            Error
            } ;

        public hash ComputeHashFromFile(string file, HashTypes hashType, HashComputerCallback callback, object prams)
            {
            
            }
    }
}
